import { useRef, useEffect, useState } from 'react';

import type { ProFormInstance } from '@ant-design/pro-form';
import { ModalForm } from '@ant-design/pro-form';

import DOCX from './docx';

type propsType = {
  title: string;
  url: string;
};

export default (props: propsType) => {
  const formRef = useRef<ProFormInstance>();

  return (
    <div className="MyComponent">
      <ModalForm
        title={props.title}
        formRef={formRef}
        trigger={<a>{props.title}</a>}
        autoFocusFirstInput
        onFinish={async (values) => {
          return true;
        }}
      >
        <DOCX url={props.url} />
      </ModalForm>
    </div>
  );
};
